using System.Collections;
using UnityEngine;

public class UIDelayAnimation : UIAnimationElement
{
	public float duration;

	public override void Play()
	{
		Stop();
		base.Play();
		StartCoroutine(DoAnimateIn());
	}

	public override void Stop()
	{
		StopAllCoroutines();
		base.Stop();
	}

	private IEnumerator DoAnimateIn()
	{
		yield return new WaitForSeconds(duration);
		OnEnd();
	}
}
